package com.se.nused;

import com.se.test.UnsafeTest;

/**
 * Created by hdu_huang on 2020/3/21.
 */
public class LockTest {

    private int i = 10;

    public static void main(String[] args) throws Exception{

        LockTest lockTest = new LockTest();

        long l1 = UnsafeTest.unsafe.getLong(lockTest, 0L);
        long l2 = UnsafeTest.unsafe.getLong(lockTest.getClass(), 0L);


        System.out.println(l1 + " " + Long.toBinaryString(l1));
        System.out.println(l2);

        Thread.sleep(60000);

        lockTest = new LockTest();

        l1 = UnsafeTest.unsafe.getLong(lockTest, 0L);
        System.out.println(l1 + " " + Long.toBinaryString(l1));
    }

}
